package Yi.Servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.Session;

import com.mysql.jdbc.interceptors.SessionAssociationInterceptor;

import Entity.Users;
import Yi.DAO.UsersDao;
import Yi.DAO.UsersDaoFactory;
@WebServlet("/nameServlet")
public class nameServlet extends HttpServlet{
	private static final long serialVersionUID = 1L;
	private UsersDao UsersDao=UsersDaoFactory.createDAO();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		String uName=(String) request.getSession().getAttribute("uName");
		String uPassword=(String) request.getSession().getAttribute("uPassword");
		//Session uName=(Session) new SessionAssociationInterceptor();
		Users users=UsersDao.get(uName);
		request.setAttribute("users", users);
		request.getSession();
		request.setAttribute("uPassword", uPassword);
		request.setAttribute("uName", uName);
		request.getRequestDispatcher("custom.jsp").forward(request, response);
		//response.sendRedirect("EditServlet");
	}
   
}